package com.groovy.learning

def x = [4,5,6]
def result = ""
switch (x) {
    case "foo" : result = "found foo"
    
    case "bar": result += "bar"
    case [4, 5, 6]:
        result = "list"
        break
    case 12..30:
        result = "range"
        break
    case Integer:
        result = "integer"
        break
    case Number:
        result = "number"
        break
    default: result = "default"
}
println result

